Skip to content

Rollup of 15 pull requests #143853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 40 commits into from
Closed

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Jul 12, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

joshtriplett and others added 30 commits July 9, 2025 13:42
This allows efficient implementations for random sources that generate a
word at a time.
* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's
  built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security
compared to the legacy random number generation methods.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Additionally, `NO_DEBUG_ASSERTIONS` is set by CI that threads through to
the `./configure` script, which is somewhat fragile and "spooky action
at a distance". Instead, use env vars controlled by compiletest, whose
debug assertion info comes from bootstrap.
The test itself is still broken, but fix this gating separately first.
…trVisitor

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This will let people make calls like random(1..=6), and allows for
future expansion to non-uniform distributions, as well as
floating-point.

For now, this is only implemented for `RangeFull`, to get the interface
in place. Subsequent commits will implement it for other range types.
They do not have sensible defaults, and it is crucial that we get them
right.
It is *critical* that we maintain clear nomenclature in `compiletest`.
We have many types of "modes" in `compiletest` -- pass modes, coverage
modes, compare modes, you name it. `Mode` is also a *super* general
term. Rename it to `TestMode` to leave no room for such ambiguity.

As a follow-up, I also intend to introduce an enum for `TestSuite`, then
rid of all usage of glob re-exported `TestMode::*` enum variants -- many
test suites share the same name as the test mode.
I would like to introduce `TestSuite` over stringly-typed test suite
names, and some test suite names are the same as test modes, which can
make this very confusing.
…ieu,tgross35

slice: Mark `rotate_left`, `rotate_right` unstably const

Tracking issue rust-lang#143812

- Add the const unstable `const_slice_rotate` feature
- Mark `<[T]>::rotate_left` and `<[T]>::rotate_right` as const unstable

The internal rotate functions use [`<*mut T>::replace`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.replace) and [`ptr::swap_nonoverlapping`](https://doc.rust-lang.org/stable/core/ptr/fn.swap_nonoverlapping.html) which were const-stabilized in 1.88.

Two changes were needed in the `rotate.rs` module to make these functions const:
1. A usage of `cmp::min` was replaced with a local function implementation of [`Ord::min`](https://doc.rust-lang.org/1.88.0/src/core/cmp.rs.html#1048-1053).
2. A `for start in 1..gcd` loop was changed to a while loop with an increment variable.

This needs libs-api approval and cc-ing const-eval.
interpret/allocation: expose init + write_wildcards on a range

Part of rust-lang/miri#4456, so that we can mark down when a foreign access to our memory happened. Should this also move `prepare_for_native_access()` itself into Miri, given that everything there can be implemented on Miri's side?

r? `@RalfJung`
…nieu

Updates to random number generation APIs

Updates based on discussions about random number generation.

- Add comment on `RandomSource::fill_bytes` about multiple calls, to allow
  efficient implementations for random sources that generate a word at a time.

- Drop the `Random` trait in favor of `Distribution<T>`, which will let people
  make calls like random(1..=6), and which allows for future expansion to
  non-uniform distributions, as well as floating-point. (For now, this is only
  implemented for `RangeFull`, to get the interface in place. Subsequent PRs
  will implement it for other range types.)
constify `From` and `Into`

tracking issue rust-lang#143773

r? ``@fee1-dead``

I did not mark any impls elsewhere as `const`, those can happen on their own timeframe and don't need to be part of this MVP. But if there are some core ones you think should be in there I'll happily add them, just couldn't think of any
std: move NuttX to use arc4random for random number generation

arc4random support in libc merged in rust-lang/libc#4464, so:

* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security compared to the legacy random number generation methods.
jhpratt added 3 commits July 12, 2025 20:38
Access `wasi_sdk_path` instead of reading environment variable in bootstrap

Small cleanup to remove an environment variable read that we have performed earlier in bootstrap already.
./x test miri: fix cleaning the miri_ui directory

Fixes rust-lang#143680
…, r=Kobzol

[COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups

This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable.

This PR should contain no functional changes modulo the removed debugger version warning.

- Commit 1: Removes a very outdated debugger version warning.
- Commit 2: Moves `string_enum` out of `common` into `util` module.
- Commit 3: Remove `#[derive(Default)` for `Mode` and `Config`. It is very important for correctness that we *don't* `#[derive(Default)]`, because there are no sensible defaults, so stop pretending there is.
- Commit 4: Rename `Mode` -> `TestMode`, because I would like to introduce a `TestSuite` enum to stop using stringly-typed test suite names where test mode names can be the same as test suite names, and we also have a bunch of other "modes" in compiletest. Make this as unambiguous as possible. A corollary is that now it's more natural to reference via intra-doc links as ``[`TestMode`]``.
- Commit 5: Ditto on `TestSuite`, stop glob-reexporting `TestMode::*` variants, and always use `EnumName::VariantName` form.
- Commit 6: Apparently, `src/tools/rustdoc-gui-test/` depends on `compiletest` for `//@ {compile,run}-paths` directive parsing and extraction, which involves creating a dummy `compiletest` config (hence the existence of the default impls removed in Commit 3). Make this a specific associated function with a FIXME pointing to rust-lang#143827 as I think this setup is quite questionable.

Commits {4, 5} are also intended to help improve the self-consistency in nomenclature used within compiletest.

Best reviewed commit-by-commit.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 12, 2025
@jhpratt
Copy link
Member Author

jhpratt commented Jul 12, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jul 12, 2025

📌 Commit f223ade has been approved by jhpratt

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 12, 2025
@bors
Copy link
Collaborator

bors commented Jul 12, 2025

⌛ Testing commit f223ade with merge 151dce8...

bors added a commit that referenced this pull request Jul 12, 2025
Rollup of 15 pull requests

Successful merges:

 - #143554 (slice: Mark `rotate_left`, `rotate_right` unstably const)
 - #143634 (interpret/allocation: expose init + write_wildcards on a range)
 - #143710 (Updates to random number generation APIs)
 - #143774 (constify `From` and `Into`)
 - #143776 (std: move NuttX to use arc4random for random number generation)
 - #143778 (Some const_trait_impl test cleanups)
 - #143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests)
 - #143791 (Update sysinfo version to `0.36.0`)
 - #143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute)
 - #143798 (Remove format short command trait)
 - #143803 (New tracking issues for const_ops and const_cmp)
 - #143814 (htmldocck: better error messages for some negative directives)
 - #143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap)
 - #143822 (./x test miri: fix cleaning the miri_ui directory)
 - #143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job dist-various-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] object test:false 5.194
warning: dropping unsupported crate type `dylib` for target `x86_64-fortanix-unknown-sgx`

error[E0432]: unresolved import `crate::random::Random`
 --> library/std/src/sys/pal/sgx/abi/usercalls/mod.rs:5:42
  |
5 | use crate::random::{DefaultRandomSource, Random};
  |                                          ^^^^^^
  |                                          |
  |                                          no `Random` in `random`
  |                                          help: a similar name exists in the module: `random`

error[E0599]: no function or associated item named `random` found for type `i64` in the current scope
   --> library/std/src/sys/pal/sgx/abi/usercalls/mod.rs:182:34
    |
182 |             let deviation = i64::random(&mut DefaultRandomSource).checked_rem(tenth).unwrap_or(0);
    |                                  ^^^^^^ function or associated item not found in `i64`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
[RUSTC-TIMING] std test:false 2.787

@bors
Copy link
Collaborator

bors commented Jul 12, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 12, 2025
@jieyouxu
Copy link
Member

#143710
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2025
@jieyouxu jieyouxu closed this Jul 13, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 13, 2025
@jhpratt jhpratt deleted the rollup-q9wv8di branch July 13, 2025 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.